# Copyright (c) Meta Platforms, Inc. and affiliates.

load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("../defs.bzl", "zs_library")

oncall("data_compression")

zs_library(
    name = "custom_parsers",
    srcs = [
        "dependency_registration.cpp",
    ],
    headers = [
        "dependency_registration.h",
    ],
    deps = [
        "..:zstronglib",
        "../cpp:openzl_cpp",
        "csv:csv_parser",
        "parquet:parquet_graph",
        "shared_components:clustering",
    ],
)

cpp_library(
    # @autodeps-skip
    name = "zip_lexer",
    srcs = ["zip_lexer.c"],
    headers = ["zip_lexer.h"],
    deps = [
        "..:zstronglib",
    ],
)

cpp_library(
    # @autodeps-skip
    name = "pytorch_model_parser",
    srcs = ["pytorch_model_parser.c"],
    headers = ["pytorch_model_parser.h"],
    deps = [
        "..:zstronglib",
        ":zip_lexer",
    ],
)

cpp_binary(
    # @autodeps-skip
    name = "pytorch_model_compressor",
    srcs = [
        "pytorch_model_compressor.cpp",
    ],
    deps = [
        "..:zstronglib",
        "../tools:zstrong_cpp",
        ":pytorch_model_parser",
        "//folly:file_util",
        "//folly/init:init",
    ],
)
